package stackandqueue.stack.sequentialdoublestack;

public class Main {
    public static void main(String[] args) {
        SqDoubleStack sqDoubleStack = new SqDoubleStack();
        System.out.println("向栈1压入a,b,c,d,e,向栈2压入A,B,C,D,E:");
        for (int i = 0; i < 5; i++) {
            sqDoubleStack.push((char) ('a' + i), 1);
            sqDoubleStack.push((char) ('A' + i), 2);
        }
        System.out.println("栈1元素个数：" + sqDoubleStack.stackLength(1));
        System.out.println("输出栈1栈顶元素：" + sqDoubleStack.getTop(1));
        System.out.println("栈2元素个数：" + sqDoubleStack.stackLength(2));
        System.out.println("输出栈2栈顶元素：" + sqDoubleStack.getTop(2));
        System.out.println("栈1出栈：" + sqDoubleStack.pop(1));
        System.out.println("输出栈1栈顶元素：" + sqDoubleStack.getTop(1));
        System.out.println("栈2出栈：" + sqDoubleStack.pop(2));
        System.out.println("输出栈2栈顶元素：" + sqDoubleStack.getTop(2));
        System.out.println("栈1元素出栈：");
        while (!sqDoubleStack.stackEmpty(1)) {
            System.out.print(sqDoubleStack.pop(1) + " ");
        }
        System.out.println();
        System.out.println(sqDoubleStack.stackLength(1));
        System.out.println("栈2元素出栈：");
        while (!sqDoubleStack.stackEmpty(2)) {
            System.out.print(sqDoubleStack.pop(2) + " ");
        }
        System.out.println();
        System.out.println(sqDoubleStack.stackLength(2));
    }
}
